﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace HelloMVC.Model
{
    public class DatatableRequestModel
    {
        public Int32  	iDisplayStart{get;set;}  	// Display start point
        public Int32 	iDisplayLength{get;set;} 	// Number of records to display
        public Int32 	iColumns{get;set;} 	        // Number of columns being displayed (useful for getting individual column search info)
        public String 	sSearch{get;set;} 	        // Global search field
        public Boolean bEscapeRegex{get;set;} 	    // Global search is regex or not
        public Boolean bSortable{get;set;} 	    // Indicator for if a column is flagged as sortable or not on the client-side
        public Boolean bSearchable{get;set;} 	    // Indicator for if a column is flagged as searchable or not on the client-side
        public Int32 	iSortingCols{get;set;} 	    // Number of columns to sort on
        public Int32 	iSortCol{get;set;} 	        // Column being sorted on (you will need to decode this number for your database)
        public String 	sSortDir{get;set;} 	        // Direction to be sorted - "desc" or "asc". Note that the prefix for this variable is wrong in 1.5.x where iSortDir_(int) was used)
        public String 	sEcho{get;set;} 	        // Information for DataTables to use for rendering
        public IList<String> sSearchs { get;set; }
        public IList<Boolean> bRegexs { get; set; }
        public IList<Boolean> bSearchables { get; set; }
    }

    public class DatatableResponseModel
    {
        public Int32  	iTotalRecords { get; set; }  	    // Total records, before filtering (i.e. the total number of records in the database)
        public Int32 	iTotalDisplayRecords { get; set; } 	// Total records, after filtering (i.e. the total number of records after filtering has been applied - not just the number of records being returned in this result set)
        public String 	sEcho { get; set; } 	            // An unaltered copy of sEcho sent from the client side. This parameter will change with each draw (it is basically a draw count) - so it is important that this is implemented. Note that it strongly recommended for security reasons that you 'cast' this parameter to an integer in order to prevent Cross Site Scripting (XSS) attacks.
        public String 	sColumns { get; set; } 	            // Optional - this is a string of column names, comma separated (used in combination with sName) which will allow DataTables to reorder data on the client-side if required for display
        public IList<IList<String>> aaData { get; set; }
    }
}
